<?php
return [
    'host' => env('ELASTICSEARCH_HOST'),
    'indices' => [
        'mappings' => [
            'default' => [
                'properties' => [
                    'id' => [
                        'type' => 'keyword',
                    ],
                ],
            ],
            'user_index' => [
                "properties"=>  [
                    'name' => [
                        'type' => 'text',
                        'analyzer' => 'ik_max_word',
                        'search_analyzer' => 'ik_smart',
                    ],
                    'nickname' => [
                        'type' => 'text',
                        'analyzer' => 'ik_max_word',
                        'search_analyzer' => 'ik_smart',
                    ],
                ]
            ],
            'info_index' => [
                "properties"=>  [
                    'value' => [
                        'type' => 'text',
                        'analyzer' => 'pinyin',
                    ],
                ]
            ],
            'sys_article_index' => [
                "properties"=>  [
                    'title' => [
                        'type' => 'text',
                        'analyzer' => 'ik_pinyin_analyzer',
                    ],
                    'summary' => [
                        'type' => 'text',
                        'analyzer' => 'ik_max_word',
                        'search_analyzer' => 'ik_smart',
                    ],
                    'content' => [
                        'type' => 'text',
                        'analyzer' => 'ik_max_word',
                        'search_analyzer' => 'ik_smart',
                    ],
                ]
            ],
            // more index mapping
        ],
        'settings' => [
            'default' => [
                'number_of_shards' => 1,
                'number_of_replicas' => 0,
            ],
            'sys_article_index' => [
                'analysis' => [
                    'analyzer' => [
                        'ik_pinyin_analyzer' => [
                            'type' => 'custom',
                            'tokenizer' => 'ik_smart',
                            'filter' => 'pinyin_filter',
                        ],
                    ],
                    'filter' => [
                        'pinyin_filter' => [
                            'type' => 'pinyin',
                            'keep_first_letter' => false,
                        ],
                    ],
                ],
            ],
            // more index setting
        ],
    ],
];
